# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

package(
    default_visibility = ["//visibility:public"],
    licenses = ["notice"],
)

cc_library(
    name = "util",
    testonly = True,
    srcs = ["util.cc"],
    hdrs = ["util.h"],
    deps = [
        "//gutil/gutil:status",
        "//lib/gnmi:gnmi_helper",
        "//tests:thinkit_gnmi_subscribe_tests",
        "//thinkit:control_device",
        "//thinkit:generic_testbed",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
    ],
    alwayslink = True,
)

cc_library(
    name = "link_flap_tests",
    testonly = True,
    srcs = ["link_flap_tests.cc"],
    hdrs = ["link_flap_tests.h"],
    deps = [
        ":util",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/gnmi:gnmi_helper",
        "//thinkit:control_device",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit:switch",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/container:flat_hash_set",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:span",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "host_link_flap_tests",
    testonly = True,
    srcs = ["host_link_flap_tests.cc"],
    hdrs = ["link_flap_tests.h"],
    deps = [
        ":util",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/gnmi:gnmi_helper",
        "//thinkit:control_device",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit:switch",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:span",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "ethcounter_ixia_test",
    testonly = True,
    srcs = ["ethcounter_ixia_test.cc"],
    hdrs = ["ethcounter_ixia_test.h"],
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib:ixia_helper",
        "//lib/gnmi:gnmi_helper",
        "//p4_pdpi:ir",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:pd",
        "//p4_pdpi/netaddr:mac_address",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//tests/forwarding:util",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit:switch",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_nlohmann_json//:nlohmann_json",
	"@com_google_absl//absl/cleanup",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "counter_timestamp_test",
    testonly = True,
    srcs = ["counter_timestamp_test.cc"],
    hdrs = ["ethcounter_ixia_test.h"],
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:proto",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib:ixia_helper",
        "//lib:ixia_helper_cc_proto",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi:pd",
        "//p4_pdpi/netaddr:mac_address",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//tests/forwarding:util",
        "//tests/lib:switch_test_setup_helpers",
        "//tests/qos:qos_test_util",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit:switch",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_google_glog//:glog",
        "@com_google_absl//absl/cleanup",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/time",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "blackhole_congestion_counters_ixia_test",
    testonly = True,
    srcs = ["blackhole_congestion_counters_ixia_test.cc"],
    hdrs = ["blackhole_congestion_counters_ixia_test.h"],
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:proto",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib:ixia_helper",
        "//lib/gnmi:gnmi_helper",
        "//lib/utils:generic_testbed_utils",
        "//lib/utils:json_utils",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//sai_p4/instantiations/google/test_tools:test_entries",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit:switch",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_nlohmann_json//:nlohmann_json",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:str_format",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)

cc_library(
    name = "blackhole_congestion_counters_without_ixia_test",
    testonly = True,
    srcs = ["blackhole_congestion_counters_without_ixia_test.cc"],
    hdrs = ["blackhole_congestion_counters_without_ixia_test.h"],
    deps = [
        "//gutil/gutil:collections",
        "//gutil/gutil:status_matchers",
        "//gutil/gutil:testing",
        "//lib/gnmi:gnmi_helper",
        "//lib/utils:generic_testbed_utils",
        "//lib/utils:json_utils",
        "//p4_pdpi:p4_runtime_session",
        "//p4_pdpi/netaddr:ipv4_address",
        "//p4_pdpi/netaddr:ipv6_address",
        "//p4_pdpi/packetlib",
        "//p4_pdpi/packetlib:packetlib_cc_proto",
        "//sai_p4/instantiations/google:sai_pd_cc_proto",
        "//sai_p4/instantiations/google/test_tools:test_entries",
        "//tests/lib:switch_test_setup_helpers",
        "//thinkit:control_device",
        "//thinkit:generic_testbed",
        "//thinkit:generic_testbed_fixture",
        "//thinkit:ssh_client",
        "//thinkit:switch",
        "//thinkit/proto:generic_testbed_cc_proto",
        "@com_github_gnmi//proto/gnmi:gnmi_cc_grpc_proto",
        "@com_github_google_glog//:glog",
        "@com_github_nlohmann_json//:nlohmann_json",
        "@com_google_absl//absl/container:flat_hash_map",
        "@com_google_absl//absl/memory",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/status:statusor",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/strings:string_view",
        "@com_google_absl//absl/time",
        "@com_google_absl//absl/types:optional",
        "@com_google_googletest//:gtest",
    ],
    alwayslink = True,
)
